using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameOver : MonoBehaviour
{
    // Start is called before the first frame update
    private bool isGameOver = false;
    public GameObject gameOverUI;
    private void OnCollisionEnter(Collision collision)
    {
        if (!isGameOver && collision.gameObject.CompareTag("Ground"))
        {
            isGameOver = true;
            Time.timeScale = 0f;
            if (gameOverUI != null)
            {
                gameOverUI.SetActive(true);
            }
            Debug.Log("Game Over");
        }
    }
}
